using Andromeda.Global.Business.DataObject;
using ForgeIt.Dal.dbo;
using System;

using System.Collections.Generic;
using System.Linq;
using Andromeda.Global.Data;

namespace ForgeIt.Business.Stub
{
	public abstract class LicenseHistoryStub : DataObjectModelBase
	{
		#region private fields


		private DBLicenseHistory foDBLicenseHistory;

        private License localIdLicense;


		#endregion private fields
    
		#region public constructors

		protected LicenseHistoryStub()
			: this(new DBLicenseHistory())
		{
		}

        protected LicenseHistoryStub(License foIdLicense)
          :this()
        {
            SetIdLicense(foIdLicense);
        }

		#endregion public constructors
    

		#region internal constructors

		internal LicenseHistoryStub(DBLicenseHistory foDBLicenseHistory)
		{

			this.foDBLicenseHistory = foDBLicenseHistory;

		}

		#endregion internal constructors
  

		#region protected datasource properties
		

		internal DBLicenseHistory DB_DBLicenseHistory
		{
			get { return foDBLicenseHistory ?? (foDBLicenseHistory = new DBLicenseHistory()); }
		}

		
		public override DataConnectorCollection DataObjects
		{
			get
			{
				return new DataConnectorCollection { foDBLicenseHistory } ;
			}
		}

		

		/// 
		///
		/// 
		public int IdLicenseHistory
		{
			get { return DB_DBLicenseHistory.IdLicenseHistory; }

		}

		/// 
		///
		/// 
		public int IdLicense
		{
			get { return DB_DBLicenseHistory.IdLicense; }

			set { DB_DBLicenseHistory.IdLicense = value; }

		}

		/// 
		///
		/// 
		public string Description
		{
			get { return DB_DBLicenseHistory.Description; }

			set { DB_DBLicenseHistory.Description = value; }

		}

		/// 
		///
		/// 
		public string Before
		{
			get { return DB_DBLicenseHistory.Before; }

			set { DB_DBLicenseHistory.Before = value; }

		}

		/// 
		///
		/// 
		public string After
		{
			get { return DB_DBLicenseHistory.After; }

			set { DB_DBLicenseHistory.After = value; }

		}

		#endregion protected datasource properties
    
		#region protected datasource foreign key properties
    

		///<summary>
		/// Getter method for obtainin a foreign key <see cref="License"/> object related to this object
		///</summary>
		public virtual License GetIdLicense()
		{
          return localIdLicense ?? (localIdLicense = new License(foDBLicenseHistory.GetFK_IdLicense()));
		}
    

  		///<summary>
  		/// Setter method for linking this object to a foreign key object
  		///</summary>
  		///<param name="item">The <see cref="License"/> object to which we want to link our IdLicense</param>
  		public virtual void SetIdLicense(License item)
        {
          foDBLicenseHistory.SetFK_IdLicense(item.DB_DBLicense);
          localIdLicense = new License(foDBLicenseHistory.GetFK_IdLicense());
        }

  
		#endregion protected datasource foreign key properties
    
		#region protected datasource external key properties
    

  
		#endregion protected datasource external key properties
    
		#region properties
    

		#endregion properties
    
		#region methods methods

		#endregion methods

        #region Static Factories

        public static LicenseHistory GetLicenseHistory(int foIdLicenseHistory)
        {
          return new LicenseHistory(DBLicenseHistory.GetEntity(foIdLicenseHistory));
        }
  
        public static IEnumerable<LicenseHistory> ListLicenseHistory()
        {
            return (from DBLicenseHistory entity in DBLicenseHistory.ListEntity() select new LicenseHistory(entity));
        }
        
  
        public static IEnumerable<LicenseHistory> ListLicenseHistory(object foIdLicenseHistory, object foIdLicense, object foDescription, object foBefore, object foAfter)
        {
            return (from DBLicenseHistory entity in DBLicenseHistory.ListEntity(foIdLicenseHistory, foIdLicense, foDescription, foBefore, foAfter) select new LicenseHistory(entity));
        }
        
        #endregion Static List Methods

	
  }
}